/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Donnees;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mizho
 */
@Entity
@Table(name = "exocontenu")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ExoContenu.findAll", query = "SELECT e FROM ExoContenu e"),
    @NamedQuery(name = "ExoContenu.findByIdexocontenu", query = "SELECT e FROM ExoContenu e WHERE e.idexocontenu = :idexocontenu"),
    @NamedQuery(name = "ExoContenu.findByIndexcontenu", query = "SELECT e FROM ExoContenu e WHERE e.indexcontenu = :indexcontenu")})
public class ExoContenu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "idexocontenu")
    private String idexocontenu;
    @Basic(optional = false)
    @NotNull
    @Column(name = "indexcontenu")
    private int indexcontenu;
    @JoinColumn(name = "exercice", referencedColumnName = "idexercice")
    @ManyToOne(optional = false)
    private Exercice exercice;
    @JoinColumn(name = "contenu", referencedColumnName = "idcontenu")
    @ManyToOne(optional = false)
    private Contenu contenu;

    public ExoContenu() {
    }

    public ExoContenu(String idexocontenu) {
        this.idexocontenu = idexocontenu;
    }

    public ExoContenu(String idexocontenu, int indexcontenu) {
        this.idexocontenu = idexocontenu;
        this.indexcontenu = indexcontenu;
    }

    public String getIdexocontenu() {
        return idexocontenu;
    }

    public void setIdexocontenu(String idexocontenu) {
        this.idexocontenu = idexocontenu;
    }

    public int getIndexcontenu() {
        return indexcontenu;
    }

    public void setIndexcontenu(int indexcontenu) {
        this.indexcontenu = indexcontenu;
    }

    public Exercice getExercice() {
        return exercice;
    }

    public void setExercice(Exercice exercice) {
        this.exercice = exercice;
    }

    public Contenu getContenu() {
        return contenu;
    }

    public void setContenu(Contenu contenu) {
        this.contenu = contenu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idexocontenu != null ? idexocontenu.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ExoContenu)) {
            return false;
        }
        ExoContenu other = (ExoContenu) object;
        if ((this.idexocontenu == null && other.idexocontenu != null) || (this.idexocontenu != null && !this.idexocontenu.equals(other.idexocontenu))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Donnees.ExoContenu[ idexocontenu=" + idexocontenu + " ]";
    }
    
}
